﻿Imports OfficeWebUI.Ribbon
Imports Kimmo

Public Class Main
    Inherits MasterPage

    Private WithEvents cmdProjects As OfficeWebUI.Ribbon.LargeItem
    Public WithEvents ORH As clsOfficeRibbon
    Private WithEvents cmdTables As OfficeWebUI.Ribbon.LargeItem

    Protected Overrides Sub OnInit(e As EventArgs)
        MyBase.OnInit(e)
        Me.MasterLoad()
    End Sub

    Public Sub MasterLoad()
        Dim list As New List(Of String)
        Me.ORH = New clsOfficeRibbon()
        Dim oRH As clsOfficeRibbon = Me.ORH
        oRH.OfficeRibbonStart("OfficeRibbon1")
        oRH.ImagesFolder = "~/images/"
        oRH.ImageSuffix = ".gif"
        oRH.MasterManager = Me.Manager1
        oRH.MasterRibbon = Me.OfficeRibbon1
        oRH.MasterWorkSpace = Me.Workspace1
        oRH.Clear()
        oRH.ShowHelpButton = False
        oRH.UsePermissions = False
        oRH.ApplicationMenuColor = "lightblue"
        oRH.ApplicationMenuText = "File"
        oRH.ApplicationMenuType = OfficeWebUI.ApplicationMenuType.Backstage
        oRH.ShowToggleButton = True
        oRH.ExtraText = "Developed by Anele Mbanga - anele@mbangas.com"
        oRH.HelpURL = ""
        clsDL.SaveSetting("helpfile", oRH.HelpURL)
        oRH.ShowLeftPanel(False)
        'oRH.ApplicationMenuStart()
        'oRH.BackstagePagesStart()
        oRH.AddBackStage("Reports", "Reports", "")
        oRH.AddBackStage("Statistics", "General", "")
        'oRH.BackstagePagesEnd()
        'oRH.MenuItemsStart()
        'oRH.MenuItemsEnd()
        'oRH.ApplicationMenuEnd()
        'oRH.ExtraControlsAreaStart()
        'oRH.ExtraControlsAreaEnd()
        'oRH.ContextsStart()
        oRH.AddRibbonContext("systembuilder", "SystemBuilder.Show", False, "transparent")
        oRH.AddTab("systembuilder", "tab_systembuilder", "SystemBuilder.Show", "reporter16", True, "", "")
        oRH.AddGroup("tab_systembuilder", "grpProjects", "Projects", False, "Define projects to build software for", True, Nothing, False)
        cmdProjects = oRH.AddButton("grpProjects", "projects", "Projects", "powerpoint", False, "Create, update software projects", "", clsOfficeRibbon.ButtonSizeEnum.Large)
        cmdTables = oRH.AddButton("grpProjects", "tables", "Tables", "list", False, "Create, update tables of projects to store database content for the project", "", clsOfficeRibbon.ButtonSizeEnum.Large)
        oRH = Nothing
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Private Sub cmdProjects_Click(sender As Object, e As EventArgs) Handles cmdProjects.Click
        clsDL.SaveSetting("id", "")
        clsDL.SaveSetting("view", "projects")
        clsDL.SaveSetting("f", "frmProjects.aspx")
        WebSite.GotoPage("Default.aspx")
    End Sub

    Private Sub cmdTables_Click(sender As Object, e As EventArgs) Handles cmdTables.Click
        clsDL.SaveSetting("id", "")
        clsDL.SaveSetting("projectid", "")
        clsDL.SaveSetting("view", "tables")
        clsDL.SaveSetting("f", "frmTablesTree.aspx")
        WebSite.GotoPage("Default.aspx")
    End Sub
End Class